This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
~Justin Zenfoostergon 14.May.03 11:44 PM a Web browser Notes Client6.0.1Windows 2000
I have a view full of about 40 documents. I want to loop through them an open/edit/save each one so that a QuerySave action happens that does a bunch of other stuff.
I built the following code which generates an error that I believe is caused by the line
Call UserUIDocument.Close
If I REM out that line everything works but I end up with all the documents open.
The error is "Error 4429: Unable to defer document close"
any ideas?
==========================================
Sub Initialize
Dim Session As New NotesSession
Dim DB As NotesDatabase
Dim NoteCollection As NotesDocumentCollection
Dim UserUIDocument As NotesUIDocument
Dim UserUIWorkspace As New NotesUIWorkspace
Dim dateTime As New NotesDateTime( "12/01/94" )
Dim NoteDoc As NotesDocument
On Error Goto HandleErr
Set DB = Session.CurrentDatabase
searchFormula$ = "Form = ""Category"""
Set NoteCollection = DB.Search( searchFormula$, dateTime, 0)
Set NoteDoc = NoteCollection.GetFirstDocument
For i = 1 To NoteCollection.Count
Set UserUIDocument = UserUIWorkspace.EditDocument( True, NoteDoc)
Call UserUIDocument.Save
Call UserUIDocument.Close
Set NoteDoc = NoteCollection.GetNextDocument(NoteDoc)
Next
Msgbox "This agent has worked with " & NoteCollection.Count & " Notes." & Error, 0 + 48, "System Message"